package com.umgsai.thread.thread15;

public class Service {
	public static void printA(){
		synchronized (Service.class) {
			try {
				System.out.println(Thread.currentThread().getName() + "-" + System.currentTimeMillis() + "-进入printA");
				Thread.sleep(3000);
				System.out.println(Thread.currentThread().getName() + "-" + System.currentTimeMillis() + "-离开printA");
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
	
	public static void printB(){
		synchronized (Service.class) {
			try {
				System.out.println(Thread.currentThread().getName() + "-" + System.currentTimeMillis() + "-进入printB");
				System.out.println(Thread.currentThread().getName() + "-" + System.currentTimeMillis() + "-离开printB");
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
}
